def eratosthenes(n: int):
    #n+1个元素，每个元素都等于 0的列表
    isNotPrime = [0] * (n + 1)


    isNotPrime[0] = 1 
    isNotPrime[1] = 1

    for i in range(0, n + 1):

        if isNotPrime[i] == 0:

            for j in range(2, (n // i) + 1):
                isNotPrime[i * j] = 1
                
    for i in range(0, len(isNotPrime)):
        if isNotPrime[i] == 0:
            print(i)

    return
eratosthenes(16)
